<template>
	<view class="layout pageBg">
		<common-titile title="分类"></common-titile>
		<view class="theme">
			<navigator :url="'/pages/classList/classList?id=' + item._id + '&name=' + item.name"
				class="item" v-for="item in classfiyList" :key="item._id" :data="item"
			>
				<common-classfiy :data="item"></common-classfiy>
			</navigator>
		</view>
	</view>
</template>

<script setup>
	import {getClassfiy} from "@/api/classfiy.js"
	import {ref} from "vue";
	import {onShareAppMessage,onShareTimeline} from '@dcloudio/uni-app';
	
	const classfiyList = ref([])
	const getClassfiyList = async ()=>{
		const {data} = await getClassfiy()
		classfiyList.value = data
	}
	//分享给好友
	onShareAppMessage(() => {
		return {
			title: "噜啦壁纸-分类",
			path: "pages/classify/classify"
		}
	})

	//分享到朋友圈
	onShareTimeline(() => {
		return {
			title: "噜啦壁纸"
		}
	})
	getClassfiyList()
</script>

<style lang="scss" scoped>
	.layout {

		.theme {
			display: grid;
			grid-template-columns: repeat(3, 1fr);
			gap: 15rpx;
			margin: 50rpx 10rpx;

			.item {
				position: relative; // 设置为相对定位
			}
		}
	}
</style>